// TreeNode.cpp: implementation of the CTreeNode class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "TreeNode.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CTreeNode::CTreeNode()
	:pParent(0),
	nSubLevel(0),
	dwFileAttributes(0),
	dwNodeSizeHigh(0),
	dwNodeSizeLow(0)
{
	ftLastWriteTime.dwHighDateTime = 0;
	ftLastWriteTime.dwLowDateTime = 0;
}

CTreeNode::~CTreeNode()
{
	int nSizeLeaf = arrLeaf.GetSize();
	int nSizeSubNode = arrSubNode.GetSize();
	if (nSizeLeaf>0)
	{
		int i;
		for (i= nSizeLeaf-1; i>=0; i--)
		{
			delete arrLeaf.GetAt(i);
		}
		arrLeaf.RemoveAll();
	}
	if (nSizeSubNode>0)
	{
		int i;
		for (i= nSizeSubNode-1; i>=0; i--)
		{
			delete arrSubNode.GetAt(i);
		}
		arrSubNode.RemoveAll();
	}
}
